/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-07-22
 * Time: 10:46
 */

class Singleton {
    private static Singleton singleton = new Singleton();

    public static Singleton getSingleton() {
        return singleton;
    }

    private Singleton() {};
}

public class Demo1 {
    public static void main(String[] args) {
        Singleton s1 = Singleton.getSingleton();
        Singleton s2 = Singleton.getSingleton();
        System.out.println(s1==s2);

    }
}
